package app

import (
	"github.com/gin-gonic/gin"
	"strconv"
	logs "yxs-mall/common/log"
	"yxs-mall/common/microservice"
	"yxs-mall/common/properties"
	"yxs-mall/common/storage"
)

func Start() {
	g := gin.Default()
	// 初始化日志
	logs.InitLogger()
	// 注册路由
	InitRouter(g)
	// 注册微服务相关
	microservice.InitMicro()
	// 初始化es
	storage.NewInit()
	err := g.Run(":" + strconv.FormatInt(properties.AppConfig.Port, 10))
	if err != nil {
		panic("App start err:" + err.Error())
	}
}
